package com.iqiu.cms.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.iqiu.cms.dao.CoreCompanyDao;
import com.iqiu.cms.entity.CoreCompany;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 检测单位 Service
 */

@Service
@Transactional
public class CoreCompanyService extends BaseService<CoreCompany>{

    @Autowired private CoreCompanyDao coreCompanyDao;

    public PageQuery<CoreCompany>queryByCondition(PageQuery query){
        PageQuery ret =  coreCompanyDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelCoreCompany(List<Long> ids){
        try {
            coreCompanyDao.batchDelCoreCompanyByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除检测单位失败", e);
        }
    }
}